﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
 
    <script type='text/html' template> 
        <input type='hidden' name='PID' value="{{ d.params.PID || '' }}"/>
    </script>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>收藏类型 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select name='Type_Sel'>                      <option value='0' {{ d.params.Type_Sel == '0' ? 'selected' : '' }}>商品</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>模块ID</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='ModuleID' value='{{ d.params.ModuleID || '' }}' lay-verify='required' placeholder='模块ID' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>模块名称</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='ModuleName' value='{{ d.params.ModuleName || '' }}' lay-verify='required' placeholder='模块名称' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>    
    <div class='layui-form-item'>
        <label class='layui-form-label'>用户ID </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template lay-done='layui.data.getSelSource(d.params,"UserID_SelSource");'>
                    <select name='UserID_SelSource' id='UserID_SelSource' lay-search></select>
                </script>
            </div>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>店铺ID</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='StoreID' value='{{ d.params.StoreID || '' }}' lay-verify='required' placeholder='店铺ID' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>其他</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' name='Other1' value='{{ d.params.Other1 || '' }}' lay-verify='required' placeholder='其他' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div> 
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>

<script type="text/javascript"> 
    layui.use(['form','admin','upload','laydate'], function () {
        var form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
    });
    
    layui.data.getSelSource = function (d,sourceName) { 
         layui.use(['admin','form'], function () {
                var $ = layui.$;
                var form = layui.form;
                var admin = layui.admin;
    
            if (sourceName == "UserID_SelSource") {
                admin.req({
                    url: layui.setter.APIUrl + '/admin/userMgr/customerQuery', //实际使用请改成服务端真实接口
                    type: 'post',
                    done: function (res) {
                        //$("#UserID_SelSource").append("<option value=''>全部</option>");
                        layui.each(res.Data, function (index, eachdata) {
                            var strIsSel = '';
                            if (eachdata.PID == d.UserID_SelSource)
                                strIsSel = "selected='selected'";
                            $("#UserID_SelSource").append("<option value='" + eachdata.PID + "' " + strIsSel + ">" + eachdata.UserName + "</option>");
                        });
                        form.render('select');
                    }
                }); 
            } 
        });
    }
 
     
    layui.data.setUpload = function (d) { 
        layui.use(['upload','admin'], function () {
                var $ = layui.$,
                upload = layui.upload,
                admin = layui.admin;
                var formSelects = layui.formSelects;
      
        });
    }

    
    layui.data.datedone = function (d) { 
        layui.use(['laydate'], function () {
                var laydate = layui.laydate;
     
        });
    }   
</script>
